var/datum/simplex/S
/client/verb/test(x as num, y as num)
	world << "MAP:"

	var/size = 50
	var/len = size*size

	var/minAscii = "0"
	var/maxAscii = "9"

	if(!S)	S = new(size, size, 0.05, minAscii, maxAscii, 0, 0)
	//S.map = call("bin/Simplex", "generate_map")("[x]", "[y]")
	S.generate(x, y)



	//world << "<font face=Courier>[copytext(text, 1, 1+i)]</font>"
	var/txt = ""
	var/j = 0
	for(var/i=1, i<=len, ++i)
		if(++j > size)
			txt += "\n"
			j = 1
		var/num = 255 - ((text2ascii(S.map, i) - S.min) * 255 / abs(S.max - S.min))
		//world << "[num]"
		txt += "<span style='color:rgb([num],[num],[num]);'>[copytext(S.map,i,i+1)]</span>"
	txt += ""
//	world << "<span style='border:1px solid #161616; background-color:#ff8888;'>&nbsp;</span>"
	world << txt


/client/verb/set_seed(val as num)
	S.seed = val

/client/verb/set_scale(scale as num)
	S.mapscale = scale

/client/verb/set_modify(modify as text)
	S.modify = modify

/client/verb/printvars()
	for(var/a in S.vars)
		world << "[a] = [S.vars[a]]"

/client/verb/set_flatten(num as num)
	S.flatten = num

/*
/client/verb/mapapply(cutoff as num)
	if(!S)	return
	world.maxx = S.mapwidth
	world.maxy = S.mapheight
	for(var/x=1, x<=S.mapwidth, ++x)
		for(var/y=1, y<=S.mapheight, ++y)
			var/value = S.read(x,y)
			var/turf/T = locate(x,y,1)
			if(value < cutoff)
				T.maptext = ""
				T.icon = 'turfs.dmi'
				continue
			T.maptext = "<font color='white'>[value]</font>"
			var/icon/I = icon(icon='turfs.dmi', icon_state="")
			I.DrawBox(rgb(10*value,125,125), 1, 1, 32, 32)
			T.icon = I
*/
